package com.ichir.projects.uiflow.internal.executors;

import java.util.Map;

import com.ichir.projects.uiflow.ApplicationContext;
import com.ichir.projects.uiflow.ui.api.IUiPart;
import com.ichir.projects.uiflow.ui.api.IUiView;

public class UIViewExecutor implements IUiPartExecutor {

	@Override
	public void executeUiPart(IUiPart uiPart, ApplicationContext context, Map<String, Object> attributes) {
		if (! (uiPart instanceof IUiView)) {
			return;
		}
		System.out.println(">> execute view "+uiPart);
		IUiView view = (IUiView) uiPart;
		// refresh
		view.refreshView(context, attributes);
		// show view
		view.showView(context, attributes);
	}

}
